package com.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.*;

import org.springframework.format.annotation.DateTimeFormat;

import com.alibaba.fastjson.annotation.JSONField;


/**
 * The persistent class for the CUSWORD database table.
 * 
 */
@Entity
@NamedQuery(name="Cusword.findAll", query="SELECT c FROM Cusword c")
public class Cusword implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="CUSWORD_CWNO_GENERATOR", sequenceName="CWSEQ",initialValue=1,allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="CUSWORD_CWNO_GENERATOR")
	private Long cwno;
	
	@ManyToOne
	@JoinColumn(name="CUSNO")
	@JSONField(serialize=false)
	private Customer customer;

	private String cwval;
	
	@DateTimeFormat(pattern="yyyy-MM-dd")
	@JSONField(format="yyyy-MM-dd")
	private Date cwdval;
	
	private Double cwnum;
	
	@ManyToOne
	@JoinColumn(name="WORDNO")
	private Word word;

	public Cusword() {
	}

	public Long getCwno() {
		return cwno;
	}

	public void setCwno(Long cwno) {
		this.cwno = cwno;
	}
	
	public String getCwval() {
		return this.cwval;
	}

	public void setCwval(String cwval) {
		this.cwval = cwval;
	}
	
	public Date getCwdval() {
		return cwdval;
	}

	public void setCwdval(Date cwdval) {
		this.cwdval = cwdval;
	}

	public Double getCwnum() {
		return cwnum;
	}

	public void setCwnum(Double cwnum) {
		this.cwnum = cwnum;
	}

	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	public Word getWord() {
		return word;
	}

	public void setWord(Word word) {
		this.word = word;
	}

	@Override
	public String toString() {
		return "Cusword [cwno=" + cwno + ", cwval=" + cwval + ", cwdval=" + cwdval + ", cwnum=" + cwnum + ", word="
				+ word + "]";
	}

	
}